<%= javascript 'subnets' %>
<%= form_for @subnet do |f| %>
  <%= base_errors_for @subnet %>
  <ul class="nav nav-tabs" data-tabs="tabs">
    <li class="active"><a href="#primary" data-toggle="tab"><%= _("Subnet") %></a></li>
    <li><a href="#domains" data-toggle="tab"><%= _("Domains") %></a></li>
    <li><a href="#proxies" data-toggle="tab"><%= _("Proxies") %></a></li>
    <% if authorized_for(:controller => "host_editing", :action => "view_params") %>
      <li><a href="#params" data-toggle="tab"><%= _("Parameters") %></a></li>
    <% end %>
    <% if show_location_tab? %>
      <li><a href="#locations" data-toggle="tab"><%= _("Locations") %></a></li>
    <% end %>
    <% if show_organization_tab? %>
      <li><a href="#organizations" data-toggle="tab"><%= _("Organizations") %></a></li>
    <% end %>
  </ul>

  <div class="tab-content">

    <div class="tab-pane active" id="primary">
      <%= render 'fields', :f => f %>
    </div>
    <div class="tab-pane" id="domains">
      <%= multiple_checkboxes f, :domains, f.object, Domain, {:help_inline => _("Domains in which this subnet is part"), :size => 'col-md-6', :prefix => f.object_name}, { :label => _("Domain")} %>
    </div>
    <div class="tab-pane" id="proxies">
      <%= smart_proxy_fields f %>
    </div>

    <% if authorized_for(:controller => "host_editing", :action => "view_params") %>
      <div class="tab-pane" id="params">
        <%= render "common_parameters/parameters", { :f => f, :type => :subnet_parameters } %>
      </div>
    <% end %>

    <%= render 'taxonomies/loc_org_tabs', :f => f, :obj => @subnet %>

  </div>

  <%= submit_or_cancel f %>
<% end %>
